import request from '../utils/request'

// 获取分类信息
export function getCategoryInfo() {
    return request({
        url: '/goods/category',
        method: 'get'
    })
}

// 获取分类列表
export function getCategoryList() {
    return request({
        url: '/goods/category/list',
        method: 'get'
    })
}

// 获取所有二级分类
export function getSecondCategoryList() {
    return request({
        url: '/goods/jiang/secondCategory',
        method: 'get'
    })
}

// 添加分类
export function addCategory(category) {
    return request({
        url: '/goods/jiang/addCategory',
        method: 'post',
        data: category
    })
}

// 更新分类
export function updateCategory(category) {
    return request({
        url: '/goods/jiang/updateCategory',
        method: 'put',
        data: category
    })
}

// 删除分类
export function deleteCategory(id) {
    return request({
        url: `/goods/jiang/deleteCategory`,
        method: 'post',
        params: {
            id
        }
    })
}
